/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

package afroschool.beans;

import java.io.Serializable;
import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.Id;
import javax.persistence.NamedQueries;
import javax.persistence.NamedQuery;
import javax.persistence.Table;

/**
 *
 * @author AUTRES
 */
@Entity
@Table(name = "pays")
@NamedQueries({@NamedQuery(name = "Pays.findByCode", query = "SELECT p FROM Pays p WHERE p.code = :code"), @NamedQuery(name = "Pays.findByNompays", query = "SELECT p FROM Pays p WHERE p.nompays = :nompays"), @NamedQuery(name = "Pays.findByNationalite", query = "SELECT p FROM Pays p WHERE p.nationalite = :nationalite"), @NamedQuery(name = "Pays.findByDescription", query = "SELECT p FROM Pays p WHERE p.description = :description")})
public class Pays implements Serializable {
    private static final long serialVersionUID = 1L;
    @Id
    @Column(name = "code", nullable = false)
    private String code;
    @Column(name = "nompays")
    private String nompays;
    @Column(name = "nationalite")
    private String nationalite;
    @Column(name = "description")
    private String description;

    public Pays() {
    }

    public Pays(String code) {
        this.code = code;
    }

    public String getCode() {
        return code;
    }

    public void setCode(String code) {
        this.code = code;
    }

    public String getNompays() {
        return nompays;
    }

    public void setNompays(String nompays) {
        this.nompays = nompays;
    }

    public String getNationalite() {
        return nationalite;
    }

    public void setNationalite(String nationalite) {
        this.nationalite = nationalite;
    }

    public String getDescription() {
        return description;
    }

    public void setDescription(String description) {
        this.description = description;
    }

    @Override
    public int hashCode() {
        int hash = 0;
        hash += (code != null ? code.hashCode() : 0);
        return hash;
    }

    @Override
    public boolean equals(Object object) {
        // TODO: Warning - this method won't work in the case the id fields are not set
        if (!(object instanceof Pays)) {
            return false;
        }
        Pays other = (Pays) object;
        if ((this.code == null && other.code != null) || (this.code != null && !this.code.equals(other.code))) {
            return false;
        }
        return true;
    }

    @Override
    public String toString() {
        return "afroschool.beans.Pays[code=" + code + "]";
    }

}
